﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="fclruleset.aspx.cs" Inherits="LTJ.WebPage.SystemManage.route.fclruleset" %>
<%@ Register TagPrefix="dyj" Namespace="LTJ.Control" Assembly="LTJ.Control" %>
<%@ Register TagPrefix="dyjU" TagName="ajaxcorplist" Src="~/datacontrol/ajaxallcorplist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxroutesealist" Src="~/datacontrol/ajaxcorproutesealist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxroutecarrierlist" Src="~/datacontrol/ajaxcorproutecarrierlist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxportlist" Src="~/datacontrol/ajaxcorpportlist.ascx"%>
<%@ Register TagPrefix="dyjU" TagName="ajaxroutelist" Src="~/datacontrol/ajaxroutelinelist.ascx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>规则信息编辑</title>
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <link href="../css/comm.css" rel="stylesheet" type="text/css" />
    <script src="../js/jquery.js" type="text/javascript"></script>
    <script src="../js/prototype.js" type="text/javascript"></script>
    <script src="../js/ajaxhelper.js" type="text/javascript"></script>
    <script type="text/javascript" src="../js/common.js"></script>
    <script src="../js/jquery-choose.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="adnr">
    <fieldset>
                <legend id="opt" style="background: url(../images/icons/icon53.jpg) no-repeat 6px 50%;">
                    编辑规则信息</legend>
                <table cellspacing="0" cellpadding="4" class="adtb" width="80%">
                    <tr>
                        <td width="25%"><p class="zi1">规则对象类型:</p>
                        </td>
                        <td>
                            <p class="zi2">
                            <input type="radio" name="objtype" value="1" <%if(ruletype==1){%>checked="true"<%}%> onclick="setobj(1)" <%if(opmode=="edit"){%>disabled="true"<%}%>/>常规
                            <input type="radio" name="objtype" value="2" <%if(ruletype==2){%>checked="true"<%}%> onclick="setobj(2)" <%if(opmode=="edit"){%>disabled="true"<%}%>/>公司
                            <input type="radio" name="objtype" value="3" <%if(ruletype==3){%>checked="true"<%}%> onclick="setobj(3)" <%if(opmode=="edit"){%>disabled="true"<%}%>/>整柜全局
                            <input type="radio" name="objtype" value="4" <%if(ruletype==4){%>checked="true"<%}%> onclick="setobj(4)" <%if(opmode=="edit"){%>disabled="true"<%}%>/>线路全局
                            </p>
                        </td>
                    </tr>
                    <tr id="sealingsel">
                        <td><p class="zi1">航线选择：</p>
                        </td>
                        <td>
                        <div class="zi2 popxg" style="z-index:102">
                            <p class="ip1" style="width:300px;" id="ajaxroutelinedatalist_str"><%=rinfo.seaname1%></p>
                            <input type="hidden" id="ajaxroutelinedatalist_value" name="ajaxroutelinedatalist_value" value="<%=rinfo.port%>"/>
                            <%if(opmode=="add"){%>
                            <span class="an"></span>
                            <div class="cn" style="width: 400px;" id="ajaxroutelinedatalist_div">
                                <dyjU:ajaxroutelist runat="server" ID="aroutelist" />
                            </div>
                            <%}%>
                        </div>
                        </td>
                    </tr>
                    <tr id="corpsel">
                        <td><p class="zi1">企业选择：</p>
                        </td>
                        <td>
                        <div class="zi2 popxg" style="z-index:101">
					        <p class="ip1" id="ajaxcorpdatalist_str" style="width:300px"><%=rinfo.cname%></p>
                            <input type="hidden" id="ajaxcorpdatalist_value" name="ajaxcorpdatalist_value" value="<%=rinfo.oid%>"/>
                            <%if(opmode=="add"){%>
					        <span class="an"></span>
					        <div class="cn" style="width:400px;" id="ajaxcorpdatalist_div">
                                <dyjU:ajaxcorplist runat="server" ID="acorplist" />
					        </div>
                            <%}%>
				        </div>
                        </td>
                    </tr>
                    <tr id="dotype">
                        <td width="25%"><p class="zi1">规则操作类型:</p>
                            <input type="hidden" id="opmode" name="opmode" value="<%=opmode%>" />
                        </td>
                        <td>
                            <p class="zi2">
                            <input type="radio" name="endtype" value="1" <%if(rinfo.rtype==1){%>checked="true"<%}%> onclick="setport(1)" <%if(opmode=="edit"){%>disabled="true"<%}%>/>授权航线
                            <input type="radio" name="endtype" value="2" <%if(rinfo.rtype==2){%>checked="true"<%}%> onclick="setport(2)" <%if(opmode=="edit"){%>disabled="true"<%}%>/>航线港口
                            </p>
                        </td>
                    </tr>
                    <tr id="boatline">
                        <td>
                            <p class="zi1">船公司:</p>
                        </td>
                        <td>
                            <div class="zi2 popxg" style="z-index:100">
							    <p class="ip1" id="ajaxroutecarrierdatalist_str" style="width:300px"><%=rinfo.boatname%></p>
                                <input type="hidden" id="ajaxroutecarrierdatalist_value" name="ajaxroutecarrierdatalist_value" value="<%=rinfo.boatcode%>"/>
                                 <%if(opmode=="add"){%>
					            <span class="an"></span>
					            <div class="cn" style="width:400px;" id="ajaxroutecarrierdatalist_div">
                                    <dyjU:ajaxroutecarrierlist runat="server" ID="aroutecarrlist" />
					            </div>
                                <%}%>
						    </div>
                        </td>
                    </tr>
                    <tr id="routeline">
                        <td>
                            <p class="zi1">航线:</p>
                        </td>
                        <td>
                            <div class="zi2 popxg" style="z-index:99">
							    <p class="ip1" id="ajaxcorproutedatalist_str" style="width:300px"><%=rinfo.seaname%></p>
                                <input type="hidden" id="ajaxcorproutedatalist_value" name="ajaxcorproutedatalist_value" value="<%=rinfo.rid%>"/>
                                <%if(opmode=="add"){%>
					            <span class="an"></span>
					            <div class="cn" style="width:400px;" id="ajaxcorproutedatalist_div">
                                    <dyjU:ajaxroutesealist runat="server" ID="aroutesealist" />
					            </div>
                                <%}%>
						    </div>
                        </td>
                    </tr>
                    <tr id="port">
                        <td>
                            <p class="zi1">目的港口:</p>
                        </td>
                        <td>
                            <div class="zi2 popxg" style="z-index:98">
					            <p class="ip1" id="ajaxcorpportdatalist_str" style="width:300px"><%=rinfo.portname%></p>
                                <input type="hidden" id="ajaxcorpportdatalist_value" name="ajaxcorpportdatalist_value" value="<%=rinfo.port%>"/>
                                <%if(opmode=="add"){%>
					            <span class="an"></span>                                
					            <div class="cn" style="width:400px;" id="ajaxcorpportdatalist_div">
                                    <dyjU:ajaxportlist runat="server" ID="aportlist" />
					            </div>
                                <%}%>
				            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <p class="zi1">价格幅度设置:</p>
                        </td>
                        <td>
                            <p class="zi2">
                                20GP<dyj:TextBox runat="server" ID="price1" CanBeNull="必填" RequiredFieldType="数据校验" MaxLength="10" Width="50"></dyj:TextBox>
                                40GP<dyj:TextBox runat="server" ID="price2" CanBeNull="必填" RequiredFieldType="数据校验" MaxLength="10" Width="50"></dyj:TextBox>
                                40HQ<dyj:TextBox runat="server" ID="price3" CanBeNull="必填" RequiredFieldType="数据校验" MaxLength="10" Width="50"></dyj:TextBox>
                            </p>
                        </td>
                    </tr>
                    <tr>
                    <td>&nbsp;</td>
                    <td><p class="zi2"><dyj:Button runat="server" ID="editrule"/>&nbsp;&nbsp;<button class="MgButton" id="cancel" onclick="parent.Lightview.hide();"><img src="../images/del.gif"/>取 消</button></p></td>
                    </tr>
                </table>
            </fieldset>
    </div>
    <input type="hidden" id="ajaxroutecode" value="" />
    </form>
</body>
<script type="text/javascript">
    jQuery(document).ready(function () {
        setport('<%=rinfo.rtype%>');
        setobj('<%=ruletype%>');
        choose("popxg");
    });

    function setport(i) {
        if (i == 2) document.getElementById("port").style.display = "";
        else document.getElementById("port").style.display = "none";
    }

    function setobj(i) {
        var obj1 = document.getElementById("corpsel");
        var obj2 = document.getElementById("dotype");
        var obj3 = document.getElementById("routeline");
        var obj4 = document.getElementById("port");
        var obj5 = document.getElementById("sealingsel");
        var obj6 = document.getElementById("boatline");

        if (i == 2) {
            obj1.style.display = "";
            obj2.style.display = "none";
            obj3.style.display = "none";
            obj4.style.display = "none";
            obj5.style.display = "none";
            obj6.style.display = "none";
        } else if (i == 3) {
            obj1.style.display = "none";
            obj2.style.display = "none";
            obj3.style.display = "none";
            obj4.style.display = "none";
            obj5.style.display = "none";
            obj6.style.display = "none";
        }
        else if (i == 4) {
            obj1.style.display = "none";
            obj2.style.display = "none";
            obj3.style.display = "none";
            obj4.style.display = "none";
            obj5.style.display = "";
            obj6.style.display = "none";
        } else {
            obj1.style.display = "";
            obj2.style.display = "";
            obj3.style.display = "";
            obj6.style.display = "";
            obj5.style.display = "none"
        }
    }

    function setrouterush(rvalue) {
        AjaxHelper.Updater('ajaxcorproutecarrierlist_list.ascx', 'ajaxroutecarrierdatalist', 'corpid=' + rvalue);
        setseasurerush('');
        setportrush('');
    }

    function setseasurerush(rvalue) {
        AjaxHelper.Updater('ajaxcorproutesealist_list.ascx', 'ajaxcorproutedatalist', 'corpid=' + document.getElementById('ajaxcorpdatalist_value').value + '&boatstr=' + rvalue);
        setportrush('');
    }

    function setportrush(rvalue) {
        document.getElementById('ajaxroutecode').value = rvalue;
        AjaxHelper.Updater('ajaxcorpportlist_list.ascx', 'ajaxcorpportdatalist', 'routestr=' + rvalue);
    }
</script>
</html>